home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 1 #6
/
Commodore_Disk_User_Vol.1_6_1988_-.d64
/
hex_dec convert
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
227b
|
10 lines
10 input"number in hex";hx$
20 l=len(hx$)
30 if left$(hx$,1)="$"thenhx$=right$(hx$,l-1):l=l-1
40 ifl>4then 10
50 ifl<4then hx$="0"+hx$:l=l+1:goto50
60 fora=1to4:d=asc(mid$(hx$,a,1))-48
70 ifd>9thend=d-7:if d>15thenprint"number error":goto10
80 dec=dec*16+d:next
90 printdec